def remove_whitespace_from_file(file_path):
    with open(file_path, 'r', encoding='utf-8') as file:
        content = file.read()
    
    # 去除所有空格、回车和制表符
    cleaned_content = ''.join(content.split())
    
    with open(file_path, 'w', encoding='utf-8') as file:
        file.write(cleaned_content)

# 使用函数处理 bj.txt 文件
remove_whitespace_from_file('d:\\bj.txt')